<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:gui="clr-namespace:DentalGUIHelper;assembly=DentalConfig">

    <!-- Style for the DefaultView-Buttons (the arrows) in the Toolbar of the MainWindow -->
    <Style x:Key="DefaultViewButtonStyle" TargetType="{x:Type gui:ContentAndTextButton}">
        <Setter Property="Width" Value="32" />
        <Setter Property="Height" Value="32" />
        <Setter Property="Foreground" Value="{DynamicResource ToolbarButtonForegroundBrush}" />
        <Setter Property="Background" Value="{DynamicResource DefaultViewButtonBackgroundBrush}" />
        <Setter Property="ShowText" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type gui:ContentAndTextButton}">
                    <Viewbox Margin="{TemplateBinding Padding}">
                        <Rectangle x:Name="rectangle" Width="32" Height="32" Fill="{TemplateBinding Foreground}">
                            <Rectangle.OpacityMask>
                                <VisualBrush>
                                    <VisualBrush.Visual>
                                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                    </VisualBrush.Visual>
                                </VisualBrush>
                            </Rectangle.OpacityMask>
                        </Rectangle>
                    </Viewbox>
                    <ControlTemplate.Triggers>                        
                        <Trigger Property="IsMouseOver" Value="True" >
                            <Setter Property="Opacity" Value="0.8" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="rectangle" Property="Fill" Value="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}" />
                            <Setter Property="Opacity" Value="1" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" Value="0.5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>